#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;

vector<int> arrayOfProduct(vector<int> array) {
  int product = 1;
  for (int i : array) {
    product *= i;
  }
  vector<int> ans = {};
  for (int i : array) {
    ans.push_back(product / i);
  }
  return ans;
}



int main(int argc, char const *argv[]) {
  vector<int> foo = arrayOfProduct({5,1,4,2});
  for (int i : foo) {
    cout << i << " ";
  }
  
  return 0;
}

